package com.huida.app.equal.enumtest;

import lombok.extern.slf4j.Slf4j;

/**
 * @author wangzhuangzhuang
 * @DESC:
 * @date 2022-01-02 20:50
 */
@Slf4j
public class EnumTestClass {
	public static void main(String[] args) {
		StatusEnum statusEnum = StatusEnum.DELIVERED;
		log.info("statusEnum.name(), {}", statusEnum.name()); // DELIVERED
		log.info("statusEnum.desc: {}", statusEnum.desc); // 已送达
		log.info("statusEnum.status: {}", statusEnum.status); // 1002
		log.warn("statusEnum.getStatus == 1002 ? {}", statusEnum.status == 1002); // true
	}

	enum StatusEnum {
		CREATE(1000, "已创建"),
		PAID(1001, "已支付"),
		DELIVERED(1002, "已送达"),
		FINISHED(1003, "已完成");

		private final Integer status;
		private final String desc;

		StatusEnum(Integer status, String desc) {
			this.status = status;
			this.desc = desc;
		}
	}

}